<?php
    // 查询 my_manager 表
    function get_my_manager_data(){
        $result = mysql_query("SELECT * FROM my_manager");
  
        $results = array();
        while ($row = mysql_fetch_assoc($result)) {
            $results[] = $row;
        }


        $arrData = createJsonData($results);
    
        echo json_encode($arrData);
    }



    // my_manager 登录 接口
    function manage_login(){

        $result = mysql_query("select user_name from my_manager where user_name='$_POST[user_name]'");
        $row = mysql_fetch_assoc($result);
        if ($row >= 1) {
            $result = mysql_query("select user_name from my_manager where user_name='$_POST[user_name]' 
            and pass_word='$_POST[pass_word]'");
            $row = mysql_fetch_assoc($result);
            if ($row >= 1) {
                echo success_return("登录成功");
            } else {
                echo error_return("密码错误");
            }
        } else {
            echo error_return("用户名错误");
        }
        
    }







    // my_manager 注册 接口 
    function manage_regist(){
        $result = mysql_query("select user_name from my_manager where user_name='$_POST[user_name]'");
        $row = mysql_fetch_assoc($result);
        if ($row >= 1) {
            echo error_return("该用户已存在");
        } else {
            $result = mysql_query("insert into my_manager 
            (user_name , pass_word)  
            values 
            ('$_POST[user_name]' , '$_POST[pass_word]')");
    
            $dataArr = array();
    
            if ($result >= 1) {
                echo success_return("注册成功");
            } else {
                echo error_return("注册失败");
            }
        }  
    }


    // 删除 my_manager 一条 数据
    function delete_my_manager_data(){
        mysql_query("delete from my_manager where recruit_id='$_POST[recruit_id]'");
    }

  



?>